<template>
  <div id="Index">
    <header id="headBox">
      <!-- 个人信息检索 -->
      <div class="head" @click="gotoNewPage('personalcenter','PersonalCenter')">
        <div class="headimg">
          <img src alt>
          <span>0000</span>
        </div>
        <div class="headInfo">
          <span>0000</span>
          <p>
            <span></span>
            000
          </p>
        </div>
      </div>
      <!-- 课程选择 -->
      <div class="courseSelect">
        <title @click="classShow = !classShow">课程选择</title>
        <div v-show="classShow">
          <ul>
            <li class="listActive">
              <span>课程一</span>
              <span class="btnRight btnRightActive">学习中</span>
            </li>
            <li>
              <span>课程二</span>
              <span class="btnRight">已学完</span>
            </li>
          </ul>
        </div>
      </div>
      <!-- 右侧跳转按钮 -->
      <div class="classSelect">
        <button class="goodStar"></button>
        <button class="rankingList"></button>
        <button class="personnal" @click="gotoNewPage('personalcenter','PersonalCenter')"></button>
      </div>
    </header>
    <section id="main">
      <div class="onlinePractice">
        <div class="onlinePracticeBg" @click="gotoNewPage('onlinepractice/examine','Examine')"></div>
      </div>
      <div class="unitTesting">
        <div class="unitTestingBg" @click="gotoNewPage('unittest','UnitTest')"></div>
      </div>
      <div class="learningCenter">
        <div class="learningCenterBg" @click="gotoNewPage('learningcenter','LearningCenter')"></div>
      </div>
      <div class="Live">
        <div class="LiveBg" @click="gotoNewPage('live','Live')"></div>
      </div>
    </section>
    <footer>
      <div class="dateBox"></div>
      <div class="informBox">
        <span class="bubble"></span>
      </div>
      <div class="fdBox"></div>
    </footer>
  </div>
</template>

<script>
export default {
  data() {
    return {
      classShow: false
    };
  },
  mounted() {},
  methods: {
    //路由跳转
    gotoNewPage(routerStr, componentStr) {
      this.$router.push({ path: "/" + routerStr, component: routerStr });
    }
  }
};
</script>

<style lang="scss" scoped>
#Index {
  height: 100%;
  width: 13.66rem;
  background: url("../assets/img/home/indexBg.png") no-repeat center;
  background-size: auto 100%;
  position: relative;
  #headBox {
    width: 9.94rem;
    height: 1.13rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    .head {
      // position: relative;??
      .headimg {
        position: absolute;
        top: 0.2rem;
        left: 0.3rem;
        z-index: 9;
        width: 0.84rem;
        height: 0.84rem;
        background: url("../assets/img/home/headPortrait.png") no-repeat center;
        background-size: auto 100%;
        border-radius: 50%;
        img {
          width: 0.66rem;
          height: 0.66rem;
          border-radius: 50%;
        }
        span {
          position: absolute;
          bottom: -0.07rem;
          left: 0;
          right: 0;
          margin: 0 auto;
          display: block;
          width: 0.43rem;
          height: 0.2rem;
          font-family: "PingFang SC Heavy";
          font-size: 0.12rem;
          color: #8a562a;
          background: url("../assets/img/home/icon.png") no-repeat center;
          background-size: auto 100%;
          text-align: center;
          line-height: 0.2rem;
        }
      }
      .headInfo {
        position: absolute;
        top: 0.3rem;
        left: 0.34rem;
        z-index: 1;
        width: 2.18rem;
        height: 0.68rem;
        border-radius: 0.34rem;
        background: linear-gradient(#e8fbff, #cef3fd);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        span {
          margin-left: 0.2rem;
          font-family: "PingFang SC Bold";
          font-size: 0.2rem;
          color: #009ec6;
          padding-right: 0.2rem;
        }
        p {
          margin-left: 0.6rem;
          background: #0197c0;
          border-radius: 0.2rem;
          min-width: 0.68rem;
          height: 0.27rem;
          font-family: "PingFang SC Bold";
          font-size: 0.16rem;
          color: #ffffff;
          display: flex;
          justify-content: space-around;
          align-items: center;
          padding-right: 0.15rem;
          span {
            display: block;
            width: 0.32rem;
            height: 0.27rem;
            background: url("../assets/img/home/diamond.png") no-repeat left
              center;
            background-size: auto;
            // padding: .05rem .16rem .07rem .3rem;
            padding-right: 0;
            margin-left: -0.15rem;
          }
        }
      }
    }
    .courseSelect {
      position: absolute;
      top: 0;
      left: 3.86rem;
      title {
        display: block;
        width: 2.4rem;
        height: 0.5rem;
        border-left: 0.06rem solid #d9f6fe;
        border-right: 0.06rem solid #d9f6fe;
        border-bottom: 0.06rem solid #d9f6fe;
        background: linear-gradient(#0099e5, #03c6fc);
        text-align: center;
        line-height: 0.5rem;
        font-family: "PingFang SC Bold";
        font-size: 0.24rem;
        color: #ffffff;
        border-bottom-left-radius: 0.24rem;
        border-bottom-right-radius: 0.24rem;
      }
      div::before {
        content: "";
        position: absolute;
        top: -0.115rem;
        right: 0.97rem;
        display: block;
        width: 0.09rem;
        height: 0.09rem;
        background: #d0f3fd;
        -webkit-transform: rotate(45deg);
        -moz-transform: rotate(45deg);
        -o-transform: rotate(45deg);
        transform: rotate(45deg);
      }
      div {
        position: absolute;
        top: 0.72rem;
        left: -0.7rem;
        width: 3.14rem;
        padding: 0.25rem 0.27rem;
        border: 0.06rem solid #caf3fb;
        border-radius: 0.2rem;
        background: #00ccff50;
        ul {
          list-style: none;
          li {
            list-style: none;
            width: 2.77rem;
            height: 0.44rem;
            background: #b6edfc;
            padding-left: 0.23rem;
            padding-right: 0.16rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-family: "PingFang SC Bold";
            font-size: 0.2rem;
            color: #01708b;
            border-radius: 0.22rem;
            margin-bottom: 0.06rem;
            .btnRight {
              width: 0.7rem;
              height: 0.3rem;
              font-family: "PingFang SC Bold";
              font-size: 0.14rem;
              color: #ffffff;
              background: #1ebee5;
              text-align: center;
              line-height: 0.3rem;
              border-radius: 0.15rem;
            }
            .btnRightActive {
              color: #ffffff;
              background: #ff9d00;
            }
          }
          .listActive {
            background: #f3fcff;
          }
        }
      }
    }
    .classSelect {
      position: absolute;
      top: 0.22rem;
      left: 7.67rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .goodStar {
        width: 0.72rem;
        height: 0.66rem;
        background: url("../assets/img/home/indexRight_01.png") no-repeat center;
        background-size: auto ;
      }
      .goodStar:active{
        width: 0.72rem;
        height: 0.66rem;
        background: url("../assets/img/home/indexRightActive_01.png") no-repeat center;
        background-size: auto ;
      }
      .rankingList,.personnal,.rankingList:active,.personnal:active{
        width: 0.65rem;
        height: 0.66rem;
        margin-right: 0.15rem;
      }
      .rankingList{
        background: url("../assets/img/home/indexRight_02.png") no-repeat center;
        background-size: auto ;
      }
      .rankingList:active{
        background: url("../assets/img/home/indexRightActive_02.png") no-repeat center;
        background-size: auto ;
      }
      .personnal{
        background: url("../assets/img/home/indexRight_03.png") no-repeat center;
        background-size: auto ;
      }
      .personnal:active{
        background: url("../assets/img/home/indexRightActive_03.png") no-repeat center;
        background-size: auto ;
      }
      button {
        width: 0.65rem;
        height: 0.66rem;
        margin-right: 0.15rem;
        border: none;
        background: none;
      }
    }
  }
  #main {
    position: relative;
    .onlinePractice {
      position: absolute;
      top: 2.65rem;
      left: 0.11rem;
      width: 3.7rem;
      height: 3.3rem;
      background: url("../assets/img/home/ripple.png") no-repeat center bottom;
      background-size: auto;
      .onlinePracticeBg {
        position: absolute;
        top: 0;
        left: 0.5rem;
        width: 2.53rem;
        height: 2.51rem;
        background: url("../assets/img/home/index_01.png") no-repeat center;
        background-size: auto 100%;
      }
      .onlinePracticeBg:active {
        position: absolute;
        top: 0;
        left: 0.5rem;
        width: 2.53rem;
        height: 2.51rem;
        background: url("../assets/img/home/indexActive_01.png") no-repeat
          center;
        background-size: auto 100%;
      }
    }
    .unitTesting {
      position: absolute;
      top: 1.52rem;
      left: 3.85rem;
      width: 3.72rem;
      height: 2.7rem;
      background: url("../assets/img/home/ripple_01.png") no-repeat center
        bottom;
      background-size: auto;
      .unitTestingBg {
        position: absolute;
        top: 0;
        left: 0.63rem;
        width: 2.37rem;
        height: 1.95rem;
        background: url("../assets/img/home/index_02.png") no-repeat center;
        background-size: auto 100%;
      }
      .unitTestingBg:active {
        position: absolute;
        top: 0;
        left: 0.63rem;
        width: 2.37rem;
        height: 1.95rem;
        background: url("../assets/img/home/indexActive_02.png") no-repeat
          center;
        background-size: auto 100%;
      }
    }
    .learningCenter {
      position: absolute;
      top: 4.12rem;
      left: 5.98rem;
      width: 3.62rem;
      height: 2.34rem;
      background: url("../assets/img/home/ripple_02.png") no-repeat center
        bottom;
      background-size: auto;
      .learningCenterBg {
        position: absolute;
        top: 0;
        left: 0.97rem;
        width: 1.78rem;
        height: 1.58rem;
        background: url("../assets/img/home/index_03.png") no-repeat center;
        background-size: auto 100%;
      }
      .learningCenterBg:active {
        position: absolute;
        top: 0;
        left: 0.97rem;
        width: 1.78rem;
        height: 1.58rem;
        background: url("../assets/img/home/indexActive_03.png") no-repeat
          center;
        background-size: auto 100%;
      }
    }
    .Live {
      position: absolute;
      top: 2rem;
      left: 9.11rem;
      width: 3.41rem;
      height: 2.54rem;
      background: url("../assets/img/home/ripple_03.png") no-repeat center
        bottom;
      background-size: auto;
      .LiveBg {
        position: absolute;
        top: 0;
        left: 0.68rem;
        width: 2.1rem;
        height: 2rem;
        background: url("../assets/img/home/index_04.png") no-repeat center;
        background-size: auto 100%;
      }
      .LiveBg:active {
        position: absolute;
        top: 0;
        left: 0.68rem;
        width: 2.1rem;
        height: 2rem;
        background: url("../assets/img/home/indexActive_04.png") no-repeat
          center;
        background-size: auto 100%;
      }
    }
  }
  footer {
    position: absolute;
    bottom: 0;
    left: 0;
    .dateBox {
      position: absolute;
      left: 0.37rem;
      bottom: 0.19rem;
      width: 0.68rem;
      height: 0.97rem;
      background: url("../assets/img/home/indexFooterIcon_01.png") no-repeat
        center;
      background-size: auto;
    }
    .dateBox:active {
      position: absolute;
      left: 0.37rem;
      bottom: 0.19rem;
      width: 0.68rem;
      height: 0.97rem;
      background: url("../assets/img/home/indexFooterIconActive_01.png")
        no-repeat center;
      background-size: auto;
    }
    .informBox {
      position: absolute;
      left: 1.12rem;
      bottom: 0.22rem;
      width: 0.56rem;
      height: 0.65rem;
      background: url("../assets/img/home/indexFooterIcon_02.png") no-repeat
        center;
      background-size: auto;
      .bubble {
        position: absolute;
        top: -0.24rem;
        left: 0.11rem;
        display: block;
        width: 0.2rem;
        height: 0.23rem;
        background: url("../assets/img/home/indexFooterIcon_03.png") no-repeat
          center;
        background-size: auto;
      }
    }
    .informBox:active {
      position: absolute;
      left: 1.12rem;
      bottom: 0.22rem;
      width: 0.56rem;
      height: 0.65rem;
      background: url("../assets/img/home/indexFooterIconActive_02.png")
        no-repeat center;
      background-size: auto;
    }
    .fdBox {
      position: absolute;
      left: 8.62rem;
      bottom: -0.1rem;
      width: 2.43rem;
      height: 2.36rem;
      background: url("../assets/img/home/fd.png") no-repeat center;
      background-size: auto;
    }
  }
}
</style>
